package chpt06;

public class GenericsDemo03 {
	public static<E> void display(E[] list) { // 定义泛型方法，E为类型参数
		for(int i = 0; i < list.length; i++)
			System.out.print(list[i] + " ");
		System.out.println();
	}

	public static void main(String[] args) {
		Integer[] num = {1,2,3,4,5};
		String[] str = {"Java","C","Python","PHP"};
		GenericsDemo03.display(num); // 用类名调用静态泛型方法
        GenericsDemo03.display(str);
	}
}
